<?php
require_once('libs/MySmarty.php');
require_once('libs/DbAccess.php');
require_once('classes/ad.class.php');

$formPage = new ad();

$_action = isset($_REQUEST['actionType']) ? $_REQUEST['actionType'] : 'view';
switch($_action) {
    case 'update':
		$formPage->doUpdate($_REQUEST);
		$formPage->initDropDown();
        $formPage->displayEditForm($_REQUEST);   
        break;
    case 'view':
    default:
        // viewing the guestbook
		$formPage->initDropDown();
        $formPage->displayEditForm($_REQUEST); 
        break;   
}
?>